package com.ykt.controller;

import com.jfinal.aop.Before;
import com.ykt.model.ClientVersion;
import com.ykt.service.ClientVersionService;
import com.ykt.validator.ClientValidator;
import com.ykt.vo.ResultVo;

/**
 * 版本更新
 * @author wing
 * @version 1.0.0
 */
public class ClientVersionController extends BaseController{

    private ClientVersionService versionService = enhance(ClientVersionService.class.getName(), ClientVersionService.class);


    /**查找版本更新*/
    @Before(ClientValidator.class)
    public void update(){
        int versionCode = getParaToInt("versionCode", -1);

        ClientVersion clientVersion = versionService.findByVersionCode(versionCode, ClientVersion.Type.USER);

        this.returnJson(ResultVo.success(clientVersion));
    }

}
